﻿Public Class ItemDetailGridSettings

#Region "GRID SETTINGS"
    'Dim frmToSetGrid As Windows.Forms.Form
    'Private intTotalColumns As Integer = 22      'Sale Item's no of Columns    
    'Private intGrdCntRows As Integer = 1
    'Private Sub SetGrids(ByRef fgItems As DataGridView)
    '    Try
    '        'ITEM DISPLAY GRID
    '        With fgItems

    '            .RowHeadersVisible = False
    '            .AllowUserToAddRows = False
    '            .AllowUserToDeleteRows = False
    '            .AllowUserToOrderColumns = False
    '            .AllowUserToResizeRows = False
    '            .AllowUserToResizeColumns = False

    '            '.AllowDelete = True
    '            .RowCount = intGrdCntRows
    '            '.Cols.Fixed = 0
    '            .ColumnCount = intTotalColumns
    '            .ScrollBars = ScrollBars.Both
    '            '.AllowAddNew = False
    '            .SelectionMode = DataGridViewSelectionMode.FullRowSelect




    '            'HIDDEN COLUMNS
    '            For intcnt As Integer = 0 To .ColumnCount - 1

    '                .Columns(intcnt).Visible = False
    '                .Columns(intcnt).ReadOnly = True
    '                .Columns(intcnt).Width = 0

    '                '  .Width = 0
    '            Next
    '            Call SetGridCaptions()
    '            .Columns(ItemGridColumns.CODE).Visible = True
    '            .Columns(ItemGridColumns.ITEMNAME).Visible = True
    '            .Columns(ItemGridColumns.CLRCODE).Visible = True
    '            .Columns(ItemGridColumns.CLRDESC).Visible = True
    '            .Columns(ItemGridColumns.PACK).Visible = True
    '            .Columns(ItemGridColumns.GODOWN).Visible = True
    '            .Columns(ItemGridColumns.SOLDQTY).Visible = True
    '            .Columns(ItemGridColumns.QTY).Visible = True
    '            .Columns(ItemGridColumns.DISC).Visible = True
    '            .Columns(ItemGridColumns.DISC_AMT).Visible = True
    '            .Columns(ItemGridColumns.RATE).Visible = True
    '            .Columns(ItemGridColumns.AMOUNT).Visible = True
    '            .Columns(ItemGridColumns.TAXAMT).Visible = True
    '        End With
    '    Catch ex As Exception
    '        BCommon.ErrorHandler(ex.ToString, Me.ProductName, Me.Name, "SetGrids")
    '    Finally
    '        Call SetColumnWidths()
    '    End Try
    'End Sub

    'Private Sub SetColumnWidths()
    '    Dim intColWidth As Integer = fgItems.Width / (11 * 3) '10 number of visible columns *3
    '    Try
    '        With fgItems

    '            .Columns(ItemGridColumns.CODE).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.ITEMNAME).Width = intColWidth * 7
    '            .Columns(ItemGridColumns.CLRCODE).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.CLRDESC).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.PACK).Width = intColWidth * 3
    '            .Columns(ItemGridColumns.GODOWN).Width = intColWidth * 3
    '            .Columns(ItemGridColumns.QTY).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.SOLDQTY).Width = intColWidth * 2

    '            .Columns(ItemGridColumns.DISC).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.DISC_AMT).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.RATE).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.AMOUNT).Width = intColWidth * 2
    '            .Columns(ItemGridColumns.TAXAMT).Width = intColWidth * 2


    '            txtItemCode.Width = .Columns(ItemGridColumns.CODE).Width
    '            txtItemName.Width = .Columns(ItemGridColumns.ITEMNAME).Width
    '            txtCLRCODE.Width = .Columns(ItemGridColumns.CLRCODE).Width
    '            txtCLRNAME.Width = .Columns(ItemGridColumns.CLRDESC).Width
    '            cmbPack.Width = .Columns(ItemGridColumns.PACK).Width
    '            txtGoDown.Width = .Columns(ItemGridColumns.GODOWN).Width
    '            txtSoldQty.Width = .Columns(ItemGridColumns.SOLDQTY).Width
    '            txtQty.Width = .Columns(ItemGridColumns.QTY).Width
    '            txtDisc.Width = .Columns(ItemGridColumns.DISC).Width
    '            txtDscAmt.Width = .Columns(ItemGridColumns.DISC_AMT).Width
    '            txtPrice.Width = .Columns(ItemGridColumns.RATE).Width
    '            txtItemAmount.Width = .Columns(ItemGridColumns.AMOUNT).Width


    '            txtItemCode.Left = .Left
    '            txtItemName.Left = txtItemCode.Left + txtItemCode.Width
    '            txtCLRCODE.Left = txtItemName.Left + txtItemName.Width
    '            txtCLRNAME.Left = txtCLRCODE.Left + txtCLRCODE.Width
    '            cmbPack.Left = txtCLRNAME.Left + txtCLRNAME.Width
    '            txtGoDown.Left = cmbPack.Left + cmbPack.Width
    '            txtSoldQty.Left = txtGoDown.Left + txtGoDown.Width
    '            txtQty.Left = txtSoldQty.Left + txtSoldQty.Width
    '            txtPrice.Left = txtQty.Left + txtQty.Width

    '            txtDisc.Left = txtPrice.Left + txtPrice.Width
    '            txtDscAmt.Left = txtDisc.Left + txtDisc.Width
    '            txtItemAmount.Left = txtDscAmt.Left + txtDscAmt.Width
    '        End With

    '    Catch ex As Exception
    '        BCommon.ErrorHandler(ex.ToString, Me.ProductName, Me.Name, "SetColumnWidths")
    '    End Try
    'End Sub

    'Private Sub SetGridCaptions()
    '    Try
    '        With fgItems
    '            'SET COLUMN NAMES
    '            .Columns(0).Name = "ITEMID"
    '            .Columns(1).Name = "CODE"
    '            .Columns(2).Name = "ITEMNAME"
    '            .Columns(3).Name = "CLRCODE"
    '            .Columns(4).Name = "CLRDESC"
    '            .Columns(5).Name = "PACK"
    '            .Columns(6).Name = "GODOWN"

    '            .Columns(7).Name = "SOLDQTY"
    '            .Columns(8).Name = "QTY"
    '            .Columns(9).Name = "RATE"
    '            .Columns(10).Name = "DISCVALUE"
    '            .Columns(11).Name = "DISCAMT"
    '            .Columns(12).Name = "AMOUNT"
    '            .Columns(13).Name = "STATUS"

    '            .Columns(14).Name = "CLRID"
    '            .Columns(15).Name = "GODOWNID"

    '            .Columns(16).Name = "STOCKDETAILS"
    '            .Columns(17).Name = "TAXID"

    '            .Columns(18).Name = "PACKID"
    '            .Columns(19).Name = "PACKUPDATEID"
    '            .Columns(20).Name = "TAXAMT"
    '            .Columns(21).Name = "PACKSIZEID"


    '            'SET COLUMN CAPTIONS
    '            .Columns(ItemGridColumns.ITEMID).HeaderText = "ITEMID"
    '            .Columns(ItemGridColumns.CODE).HeaderText = "CODE"
    '            .Columns(ItemGridColumns.ITEMNAME).HeaderText = "ITEMNAME"
    '            .Columns(ItemGridColumns.CLRCODE).HeaderText = "COLOR CODE"
    '            .Columns(ItemGridColumns.CLRDESC).HeaderText = "COLOR DESC"
    '            .Columns(ItemGridColumns.PACK).HeaderText = "PACK"
    '            .Columns(ItemGridColumns.GODOWN).HeaderText = "GODOWN"


    '            .Columns(ItemGridColumns.SOLDQTY).HeaderText = "QTY"
    '            .Columns(ItemGridColumns.QTY).HeaderText = "RETURNQTY"
    '            .Columns(ItemGridColumns.RATE).HeaderText = "PRICE"
    '            .Columns(ItemGridColumns.DISC).HeaderText = "DISC"
    '            .Columns(ItemGridColumns.DISC_AMT).HeaderText = "DISC AMT"
    '            .Columns(ItemGridColumns.AMOUNT).HeaderText = "AMOUNT"
    '            .Columns(ItemGridColumns.STATUS).HeaderText = "STATUS"
    '            .Columns(ItemGridColumns.CLRID).HeaderText = "COLORID"
    '            .Columns(ItemGridColumns.GODOWNID).HeaderText = "GODOWNID"
    '            .Columns(ItemGridColumns.TAXID).HeaderText = "TAX ID"
    '            .Columns(ItemGridColumns.TAXAMT).HeaderText = "TAX APPLIED"
    '            .Columns(ItemGridColumns.PACKID).HeaderText = "PACK ID"
    '            .Columns(ItemGridColumns.PACKUPDATEID).HeaderText = "PACKUPDATEID"
    '        End With
    '    Catch ex As Exception
    '        BCommon.ErrorHandler(ex.ToString, Me.ProductName, Me.Name, "SetGridCaption")
    '    End Try
    'End Sub

#End Region '"GRID SETTINGS"

End Class
